home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #048 (199x)(Scope PD)(US)[WB].zip / Scope Disk #048 (199x)(Scope PD)(US)[WB].adf / Auto13 / readme.1st < prev    next >
Text File  |  1989-01-11  |  15KB  |  287 lines

  1. Read through this original text for auto-addmem then follow the directions
  2. in autoaddmem13.
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                    AUTO-ADDMEM PATCH FOR KICKSTART
  9.          ===============================
  10.  
  11. Many Amiga owners have purchased or made expansion RAM boards for our
  12. machines.  While most of the current commercially available RAM expansions
  13. have auto-config capabilities.  Unfortunately, a lot of the earlier RAM
  14. expansions and "home brew" kits do not offer the luxury of auto-config.
  15. The ADDMEM command supplied for non auto-config expansions, while functional,
  16. requires the inconvenience of placing it in the startup-sequence of all
  17. disk that could use the RAM. This patch is for those of us without
  18. auto-config.  The patch is added to the Kickstart disk, performing the
  19. ADDMEM function whenever a "cold boot" is performed. The Kickstart 
  20. execution of ADDMEM should eliminate the problems some RAM experience with
  21. ADDMEM and recoverable RAM disks (RRD, VD0:, Survivor, etc.).
  22.  
  23. The patch instructions were originally posted by Dan Babcock (PLink: OPS239)
  24. in a text file. I was able to complete the patch in about an hour (including
  25. the drawing). This "read me" contains parts of his original with 
  26. modifications for clarity.  The patch as originally posted required 
  27. DiskZap (a disk sector editor), DPaint (a drawing program), a 68000 
  28. assembler (or knowledge of assembly), and SumKick (a checksum generator for
  29. Kickstart).  These files were not included in the instructions download. 
  30. DiskZap and SumKick are included in this archive.  I included the actual
  31. hexadecimal object code required for the patch, thus eliminating the 
  32. assembler part and Dpaint (unless you want your own artwork).
  33.  
  34. PLEASE read the docs for DiskZap and SumKick carefully before attempting the
  35. patch.  Also, work with a COPY of your Kickstart (as if that had to be said).
  36.  
  37.     ___________________ Original Text by Dan Babcock ______________________
  38.    |                                                                       |
  39.    V                                                                       V 
  40. Patching kickstart:
  41. The first question to answer is "Where do I put my patch?". One good spot
  42. is the place where the upside down hand is drawn, which is where I've
  43. put the "ADDMEM" patch. The second question is "How do I send the bootup
  44. routines to my code?". I have chosen to modify a pointer in the device
  45. driver-type structure at the beginning of the "strap" routine. How did
  46. I find out about "strap"? You type "mods" in the 1.0 version of WACK and
  47. it gives you a list of devices,resouces,and that kind of stuff. "strap"
  48. is the code that boots a "workbench" type of disk and displays the
  49. upside down hand. The address that WACK V1.0 gives you is the address of
  50. a "rom tag". A "rom tag" is a fancy name that means a bunch of data. The
  51. format of the data is found in the documentation of the skeleton device
  52. driver in the ROM KERNAL MANUAL VOLUME 2, near the very back. The pointer
  53. we are going to change is called "RT_INIT". It's a pointer to the "strap"
  54. routine. The pointer, located at address $FE889A normally contains
  55. $FE88D6. We'll change it to $FE8CFE, the part of kickstart that displays
  56. the upside down hand. I'll take about the display routine in detail
  57. later. Now we need code to put at $FE8CF8. Fortunately, V1.2 of kickstart
  58. added a very convenient command to add memory. Here's a routine to do it:
  59.  
  60.  JMP $FE8D6A ;SKIP OVER THIS PATCH (SO IT WILL ONLY BE RUN ONCE)
  61.  MOVEM.L D0/D1/D2/A0/A1/A6,-(A7)
  62.  MOVE.L 4,A6
  63.  MOVE.L #NUMBER OF BYTES TO ADD,D0
  64.  MOVE.L #$10005,D1 ; ADD "FAST" MEMORY
  65.  MOVEQ #0,D2
  66.  MOVE.L #$ADDRESS OF EXTRA MEMORY,A0
  67.  SUB.L A1,A1
  68.  JSR -618(A6)
  69.  MOVEM.L (A7)+,D0/D1/D2/A0/A1/A6
  70.  JMP $FE88D6 ;GO TO THE NORMAL "STRAP" PROGRAM. OUR PART IS FINISHED.
  71.  
  72. Simple eh? IMPORTANT NOTE!!!:
  73. If you have done the AMAZING COMPUTING 512K upgrade and did the 2 chip
  74. fix which disables the RAM so it won't be allocated as chip RAM....
  75. you must add a few lines of code to enable the RAM BEFORE you do the
  76. add!!!! A few lines like this:
  77.  
  78.  BCLR #7,$BFD100 ;TURN ON MOTOR
  79.  BSET #3,$BFD100
  80.  BCLR #3,$BFD100
  81.  BSET #7,$BFD100 ;TURN OFF MOTOR
  82.  BSET #3,$BFD100
  83.  BCLR #3,$BFD100
  84.  
  85. The changes can be made fairly easily using DISKZAP. Here are the sector
  86. numbers: (I think the byte numbers are right, but double check me!
  87. That goes for all the numbers I give in this file.)
  88.    
  89. The pointer: SECTOR $145, BYTE $9A
  90. The display hand patch code: SECTOR $147, BYTE $F8
  91.  
  92. ***********************************************************************
  93. ******** NOW FOR THE REALLY FUN PART!!!!!
  94. ******** AMAZE YOUR FRIENDS WITH A CUSTOM BIT MAP WHERE THE
  95. ******** "INSERT WORKBENCH" SCREEN USED TO BE (BEFORE YOU MODIFIED
  96. ******** IT USING THE INFORMATION BELOW)
  97. ***********************************************************************
  98.  
  99. THE DISPLAY HAND ROUTINE IN DETAIL:
  100. This is the routine that is called when you boot (or reset) and have a
  101. disk in the drive that is not a bootable disk (or no disk at all).
  102. The infamous "upside down hand" routine.
  103. It uses a combination of line drawing and straight bit maps to optimize
  104. memory use. The hand and the disk are made by drawing lines and doing area
  105. fills. The text - "Work Bench", "V1.2" - is made using straight bit maps.
  106. Because the routine is table driven, modifying the display is easy.
  107. All you have to know is the format of the tables. Since the AUTO-ADDMEM
  108. fix discribed above uses the line draw portion for space, I will talk
  109. about the bit map part. First, load up DPAINT and create a picture, any
  110. picture, as long as it isn't too big. USE THE ONE COLOR MODE!
  111.  Before you get a feel for how much
  112. room you have, keep it very small. Save it as a brush, so it won't be saved
  113. in a compressed format. Now you need to know the format of the bit map in
  114. "strap":
  115.  
  116. The first byte determines whether or not this is the last display
  117. sequence. If the high bit is set, the routine exits. The second byte
  118. is a bit plane mask, determining which bit planes may be written to.
  119. If this is $FF, then all bit planes are writable. Which ones are actually
  120. written to depend on which color register was defined as the "pen". In
  121. this case, color register 3 was chosen. This means that, assuming all bit
  122. planes are enabled, bit planes 1 and 2 will be written in with ones,
  123. selecting color register 3, just like we asked. If however, we set the
  124. mask to 2, only bit plane 2 will be written in, and so we will actually
  125. be displaying color register 2. If we put a 1 in, color 1 is displayed, and
  126. if 0 is there, nothing is displayed (not real useful). Nothing mysterious
  127. there. The third and forth bytes are the dimensions of the thing we are
  128. displaying, the third byte being the width and the forth the height.
  129. The fifth and sixth bytes are the coordinates to place the picture, first
  130. X, then Y. After that is the actual data.
  131.  
  132. "Where do I get the 'actual data'?"
  133.  
  134. where "FILENAME" is the name of your picture. You should see a bunch of
  135. hexadecimal numbers and ASCII text to the right. Notice "ILBMHMHD".
  136. After that notice 4 bytes which are of no use to us. Continue and note
  137. that you find the width and height as 1 word each next to each other
  138. in a convienient hex form. Write them down so we know them later. Next find
  139. "BODY" and notice the size in bytes following it. I hope that number
  140. isn't larger than about $190!! If it is, scale back a bit. Now the
  141. nasty part: copy down all those strange looking numbers following the
  142. size. This is another reason to keep the picture small!!! As mentioned
  143. before, your picture can be displayed in any of 3 color registers.
  144. You can define the color registers to be anything you want. Just
  145. locate sector $146 and find the byte sequence that is as follows:
  146. 0FFF0000077C0BBB. They are the first 4 color registers. Place your picture
  147. in the format discribed above at sector $148, byte $1B8 (or whereever you
  148. see "00010408...")
  149.  
  150. For those of you who have been busily skipping over all of the above and
  151. just want an example, here it is:
  152.  
  153. 00            01        04     08      55 66              0123456787898...
  154. more to come  color #1  width  height  X & Y destination  your picture
  155. (FF-the end)
  156.  
  157. There is no limit to what kinds of things you can create except how
  158. many bytes you can find!! I personally have a simple white on black
  159. "INSERT DOS", but you could get really elaborate. For example, you
  160. could write a custom routine to draw a circle with a line through it and
  161. the letters S and T in the center. BE CREATIVE!!! HAVE FUN!!!
  162.  
  163. -- Dan Babcock, user OPS239. If you ever have any questions at any time,
  164. just send me a message and I will try to answer.
  165.  
  166.    ^                                                                    ^
  167.    |___________________  end of original text  _________________________|
  168.    
  169.  
  170. To make things a little easier the assembled code for the above code examples
  171. appears below.   The four columns under the OBJECT label contain the
  172. data to be entered using Diskzap at block # $147 (Hex) byte # $F8 (Hex).
  173. below each code example is the position in the DiskZap screen that 
  174. the changes would appear.  The only difference from the original patch
  175. above is the zero long word (4 bytes) at $FE8D60.  This long word will be
  176. used for checksum correction later on.
  177.  
  178.         xxxxxxxx  =  continuation address
  179.                   =  00FE8D6A  (for normal exit with artwork display)
  180.                   =  00FE8DCA  (to skip artwork display)
  181.         
  182.         yyyyyyyy  =  number of bytes in extension RAM
  183.    
  184.         zzzzzzzz  =  starting address of extension RAM
  185.         (all numbers are 4 bytes with leading zeros)
  186.    
  187. ===================== NORMAL EXTENSION RAM PATCH ==========================
  188. LOC              OBJECT          STMT            SOURCE STATEMENT
  189. ------     ----------------      ----     --------------------------------
  190. FE8CF8                             1      ORG      $FE8CF8
  191. FE8CF8     4EF9  xxxx  xxxx        2      JMP      $xxxxxxxx
  192. FE8CFE     48E7  E0C2              3      MOVEM.L  D0/D1/D2/A0/A1/A6,-(A7)
  193. FE8D02     2C78  0004              4      MOVE.L   4,A6
  194. FE8D06     203C  yyyy  yyyy        5      MOVE.L   #$yyyyyyyy,D0
  195. FE8D0C     223C  0010  0005        6      MOVE.L   #$100005,D1
  196. FE8D12     7400                    7      MOVEQ    #0,D2
  197. FE8D14     207C  zzzz  zzzz        8      MOVE.L   #$zzzzzzzz,A0
  198. FE8D1A     93C9                    9      SUB.L    A1,A1
  199. FE8D1C     4EAE  FD96             10      JSR      -618(A6)
  200. FE8D20     4CDF  4307             11      MOVEM.L  (A7)+,D0/D1/D2/A0/A1/A6
  201. FE8D24     4EF9  00FE  88D6       12      JMP      $FE88D6
  202. FE8D60                            13      ORG      $FE8D60
  203. FE8D60     0000  0000             14      DCB.L    1,0
  204.  
  205. DiskZap display (starting at block # $147, byte # $0F8):
  206. 0E0                                                         4EF9XXXX XXXX48E7
  207. 100   E0C22C78 000420C3 yyyyyyyy 223C0010 00057400 207Czzzz zzzz93C9 4EAEFD96
  208. 120   4CDF4307 4EF900FE 88D6  
  209. 140
  210. 160   00000000
  211.  
  212. =================== AMAZING COMPUTING 512K UPGRADE =======================
  213. LOC              OBJECT          STMT            SOURCE STATEMENT
  214. ------     ----------------      ----     --------------------------------
  215. FE8CF8                              1     ORG      $FE8CF8
  216. FE8CF8     4EF9  xxxx  xxxx         2     JMP      $xxxxxxxx
  217. FE8CFE     48E7  E0C2               3     MOVEM.L  D0/D1/D2/A0/A1/A6,-(A7)
  218. FE8D02     08B9  0007  00BF  D100   4     BCLR     #7,$BFD100
  219. FE8D0A     08F9  0003  00BF  D100   5     BSET     #3,$BFD100
  220. FE8D12     08B9  0003  00BF  D100   6     BCLR     #3,$BFD100
  221. FE8D1A     08F9  0007  00BF  D100   7     BSET     #7,$BFD100
  222. FE8D22     08F9  0003  00BF  D100   8     BSET     #3,$BFD100
  223. FE8D2A     08B9  0003  00BF  D100   9     BCLR     #3,$BFD100
  224. FE8D32     2C78  0004              10     MOVE.L   4,A6
  225. FE8D36     203C  yyyy  yyyy        11     MOVE.L   #$yyyyyyyy,D0
  226. FE8D3C     223C  0010  0005        12     MOVE.L   #$100005,D1
  227. FE8D42     7400                    13     MOVEQ    #0,D2
  228. FE8D44     207C  zzzz  zzzz        14     MOVE.L   #$zzzzzzzz,A0
  229. FE8D4A     93C9                    15     SUB.L    A1,A1
  230. FE8D4C     4EAE  FD96              16     JSR      -618(A6)
  231. FE8D50     4CDF  4307              17     MOVEM.L  (A7)+,D0/D1/D2/A0/A1/A6
  232. FE8D54     4EF9  00FE  88D6        18     JMP      $FE88D6
  233. FE8D60                             19     ORG      $FE8D60
  234. FE8D60     0000  0000              20     DCB.L    1,0
  235.  
  236. DiskZap display (starting at block # $147, byte # $0F8):
  237. 0E0                                                         4EF9XXXX XXXX48E7
  238. 100   E0C208B9 000700BF D10008F9 000300BD D10008B9 000300BF D10008F9 000700BF
  239. 120   D10008F9 000300BF D10008B9 000300BF D1002C78 0004203C 00100005 207Czzzz
  240. 140   zzzz93C9 4EAEFD96 4CDF4307 4EF900FE 88D6
  241. 160   00000000
  242.  
  243. =========================  "INSERT WORKBENCH" IMAGE  ========================
  244.  
  245. DiskZap display (starting at block # $148, byte # $1B8):
  246. 1A0                                                00028525 5D510A19 E7FF1FFF
  247. 1C0   F7FFFFF7 FFF1FAFF 0A99FFFF 9FFFE7FF FFE7FFF9 FAFF0D93 C7C399C1 C1C313C1
  248. 1E0   FFC9C383 C3FDFF0A 87E79993 9FE7F989 E7FF91FE 99FDFF09 93E79F87 C3E7E199
  249.  
  250. DiskZap display (starting at block # $149, byte # $000):
  251. 000   E7FFFE99 0081FDFF 0999E799 93F9E599 9FE5FFFE 99009FFE E700FF0D 19C3C319
  252. 020   83F3C40F F3FFC4C3 99C3FEE7 00FFEFFF EFFFEFFF 03E7F1F1 7DFEFF00 F1F7FF03
  253. 040   C3F9F939 FEFF00F9 F7FF0AC3 C9C911C3 99FFC9C3 83C3FAFF 07999191 019988FF
  254. 060   91FE99FA FF068199 99298194 FFFE9900 81FAFF06 3C999939 9F9CFFFE 99009FFE
  255. 080   E7FDFF0A 3CC4C439 C39CFFC4 C399C3FE E7FDFFEF FFEFFFEF FFEFFFEF FFEFFFEF
  256. 0A0   FFEFFFEF FFEFFFEF FFEFFFEF FF0081FD FF06F7FF 39FFFF1F 1FFEFF02 1FFFFF00
  257. 0C0   E7FDFF06 E7FF39FF FF9F9FFE FF029FFF FF11E783 C1C313C1 FF39C313 9993C383
  258. 0E0   C393FFFF 0BE7999F 9989E7FF 29998993 89FE9902 89FFFF11 E799C381 99E7FF01
  259. 100   99998799 81999F99 FFFF0CE7 99F99F9F E5FF1199 9F93999F FE99FFFF 11819983
  260. 120   C30FF3FF 39C30F19 C3C399C3 19FFFF00
  261.  
  262. =============================================================================
  263.  
  264. Use DiskZap to insert the appropriate ADDMEM patch and the image patch
  265. to your kickstart disk.  Remember, the image patch need not be used
  266. if you used 00FE8DCA for the xxxxxxxx value in the code patch.  This
  267. will save the tedious image entry but will leave a blank screen where
  268. "Insert Workbench" used to be.
  269.  
  270. If all has gone well, your Kickstart will work as is, with one exception.
  271. The checksum of the Kickstart disk has been corrupted by the changes.
  272. this is where the SumKick program comes in.  Use SumKick to determine the
  273. current checksum of the disk.  The result is a 4 byte hexadecimal number.
  274. Write it down EXACTLY as it appears. Subtract the original checksum,
  275. $56F2E2A6 from the current one.  Use DiskZap again to locate the dummy 
  276. zero longword at address $FE8D60 (block # $147, byte # $160).  Replace the
  277. four zero bytes with the result of the subtraction.  Use SumKick again
  278. to correct the checksum.  This time the checksum should be $56F2E2A6.
  279. The disk is ready to be used.  Delete the ADDMEM commands from your
  280. startup-sequences AFTER you get this to work.  The Guru will visit you
  281. if you try to ADDMEM after you ADDMEM'd.  Good Luck! Happy Hacking!
  282.  
  283.  
  284.                                                      Brian Allston
  285.                                                      PLink: BKA
  286.                                                     
  287.